#ifndef __Math_MenuManager__
#define __Math_MenuManager__

#include "cocos2d.h"
#include <cocostudio/cocostudio.h>
#include "ui/CocosGUI.h"
USING_NS_CC;
using namespace cocostudio;
using namespace ui;
class MenuManager : Layer
{
private:
	Size m_screenSize;
	Node* m_node;
	Node* m_pnlHome;
	Node* m_pnlGuri;
	Node* m_pnlHelp;
	Node* m_pnlExit;
	Node* m_pnlPurchase;
	Button* m_btnSetting;
	Node* m_pnlSetting;
	timeline::ActionTimeline *m_timeline;

	bool m_isOpenSetting;
	void setOpenSettingProperty();

	//IAP
	virtual void onEnter();
	virtual void onExit();
	virtual void updateFullVersion(Ref *pSender);

	//HOME 
	void tapSetting(Ref* pSender);
	void tapMode(Ref* pSender);
	void tapPurchase(Ref* pSender);
	void tapFacebook(Ref* pSender);
	void tapTwitter(Ref* pSender);
	void tapGuri(Ref* pSender);
	void tapHelp(Ref* pSender);
	void tapSound(Ref* pSender);
	void tapMusic(Ref* pSender);

	//GURI
	void tapCloseGuri(Ref* pSender);

	//Help
	void tapCloseHelp(Ref* pSender);

	//Exit
	void tapYesExit(Ref* pSender);
	void tapNoExit(Ref* pSender);

	//Purchase
	void tapPurchaseEasy(Ref* pSender);
	void tapPurchaseNormal(Ref* pSender);
	void tapPurchaseHard(Ref* pSender);
	void tapClosePurchase(Ref* pSender);

	void initBackground();
	void initLayer();
	void initComponent();
	void initButton();
	void initGhostBanner();

    void readPositionGhost();
	void openPanelHome();

	virtual void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event);
public:
    static bool m_isProcressing;
	~MenuManager();

	void initalize();

	static Scene* createScene();
	virtual bool init();
	CREATE_FUNC(MenuManager);
};


#endif
